package com.itheima.order.service;

import com.itheima.order.dao.OrderDao;
import com.itheima.order.pojo.Order;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;

import java.util.List;

@Service
public class OrderService {
    @Autowired
    private OrderDao orderDao;

    public List<Order> findOrderByUserName(String username){
       /* Example example = new Example(Order.class);
        Example.Criteria criteria = example.createCriteria();
        criteria.andEqualTo("username",username);
        List<Order> orders = orderDao.selectByExample(criteria);*/
        Order order = new Order();
        order.setUsername(username);
        List<Order> orders = orderDao.select(order);
        return orders;
    }
}
